package com.song.alibaba.book.controller;

import com.song.alibaba.book.domain.Book;
import com.song.alibaba.book.service.BookService;
import entity.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/book")
public class BookController {
    @Resource
    private BookService bookService;

    @GetMapping("/books")
    public R<List<Book>> findBooks(){
        return new R( 200,"查询图书列表成功！",this.bookService.list());
    }
}
